package com.mikhailenko.transportMVC.repository.es;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.mikhailenko.transportMVC.model.es.InputEntity;

public interface InputRepository extends JpaRepository<InputEntity, Integer> {

	@Query("SELECT input FROM inputs input WHERE input.name = :name ")
    InputEntity findByName(@Param("name") String name);
	
	@Query("SELECT input FROM inputs input WHERE input.block.id = :id ")
    List<InputEntity> findByBlockId(@Param("id") int id);
}
